package org.jeecg.modules.demo.soOrderDetail.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jetbrains.annotations.NotNull;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Description: so_order_detail
 * @Author: jeecg-boot
 * @Date: 2021-12-10
 * @Version: V1.0
 */
@Data
@TableName("so_order_detail")
@ApiModel(value = "so_order_detail对象", description = "so_order_detail")
public class SoOrderDetail  implements Serializable, Comparable<SoOrderDetail> {
    private static final long serialVersionUID = 1L;

    /**
     * 入库单号
     */
    @Excel(name = "入库单号", width = 15)
    @ApiModelProperty(value = "入库单号")
    private String rkNo;
    /**
     * 仓库编码
     */
    @Excel(name = "仓库编码", width = 15)
    @ApiModelProperty(value = "仓库编码")
    @Dict(dicCode = "store_house")
    private String whNum;
    /**
     * 产品批号
     */
    @Excel(name = "产品批号", width = 15)
    @ApiModelProperty(value = "产品批号")
    private String prdLot;
    /**
     * 仓库编码(采购)
     */
    @Excel(name = "仓库编码(采购)", width = 15)
    @ApiModelProperty(value = "仓库编码(采购)")
    private String puWhNum;
    /**
     * 订单状态（0：未审，1：已审，2：已关闭）
     */
    @Excel(name = "订单状态（0：未审，1：已审，2：已关闭）", width = 15)
    @ApiModelProperty(value = "订单状态（0：未审，1：已审，2：已关闭）")
    private Integer sodStatus;
    /**
     * 是否已生成质检单（0：否，1：是）
     */
    @Excel(name = "是否已生成质检单（0：否，1：是）", width = 15)
    @ApiModelProperty(value = "是否已生成质检单（0：否，1：是）")
    private Integer isQuality;
    /**
     * 删除状态（0：未删，1：已删）
     */
    @Excel(name = "删除状态（0：未删，1：已删）", width = 15)
    @ApiModelProperty(value = "删除状态（0：未删，1：已删）")
    private Integer isDelete;
    /**
     * 产品名称
     */
    @Excel(name = "产品名称", width = 15)
    @ApiModelProperty(value = "产品名称")
    private String prdNo;
    /**
     * 规格型号
     */
    @Excel(name = "规格型号", width = 15)
    @ApiModelProperty(value = "规格型号")
    private String target;
    /**
     * 计量单位
     */
    @Excel(name = "计量单位", width = 15)
    @ApiModelProperty(value = "计量单位")
    private String jldw;
    /**
     * 单价
     */
    @Excel(name = "单价", width = 15)
    @ApiModelProperty(value = "单价")
    private Double price;
    /**
     * 业务类型
     */
    @Excel(name = "业务类型", width = 15)
    @ApiModelProperty(value = "业务类型")
    private String ywType;
    /**
     * 出库成本金额
     */
    @Excel(name = "出库成本金额", width = 15)
    @ApiModelProperty(value = "出库成本金额")
    private BigDecimal cbJine;
    /**
     * 实际出库量
     */
    @Excel(name = "实际出库量", width = 15)
    @ApiModelProperty(value = "实际出库量")
    private BigDecimal xclNum;
    /**
     * id
     */
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "id")
    private String id;
    /**
     * 出库单号
     */
    @Excel(name = "出库单号", width = 15)
    @ApiModelProperty(value = "出库单号")
    private String sodNo;
    /**
     * 销售结算单号
     */
    @Excel(name = "销售结算单号", width = 15)
    @ApiModelProperty(value = "销售结算单号")
    private String sosCeptNo;
    /**
     * 合同编号
     */
    @Excel(name = "合同编号", width = 15)
    @ApiModelProperty(value = "合同编号")
    private String soConNo;
    /**
     * 销售订单号
     */
    @Excel(name = "销售订单号", width = 15)
    @ApiModelProperty(value = "销售订单号")
    private String soOrder;
    /**
     * 出库数量
     */
    @Excel(name = "应出库量", width = 15)
    @ApiModelProperty(value = "应出库量")
    private BigDecimal sodQuantity;
    /**
     * 销售结算状态
     */
    @Excel(name = "销售结算状态", width = 15)
    @ApiModelProperty(value = "销售结算状态")
    private Integer sodSetStatus;
    /**
     * 制单日期
     */
    @Excel(name = "制单日期", width = 15, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "制单日期")
    private Date sodDate;
    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    /**
     * 项目
     */
    @Excel(name = "项目", width = 15)
    @ApiModelProperty(value = "项目")
    @Dict(dictTable = "pj_project", dicCode = "id", dicText = "pj_name")
    private String project;
    /**
     * 客户
     */
    @Excel(name = "客户", width = 15)
    @ApiModelProperty(value = "客户")
    private String soCustom;
    /**
     * 出库类型
     */
    @Excel(name = "出库类型", width = 15)
    @ApiModelProperty(value = "出库类型")
    @Dict(dicCode = "ckType")
    private String ckType;
    /**
     * 业务员
     */
    @Excel(name = "业务员", width = 15)
    @ApiModelProperty(value = "业务员")
    @Dict(dictTable = "sys_user", dicCode = "id", dicText = "realname")
    private String soStaff;
    /**
     * 审核人
     */
    @Excel(name = "审核人", width = 15)
    @ApiModelProperty(value = "审核人")
    @Dict(dictTable = "sys_user", dicCode = "id", dicText = "realname")
    private String shName;
    /**
     * 审核时间
     */
    @Excel(name = "审核时间", width = 15)
    @ApiModelProperty(value = "审核时间")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Date shTime;
    /**
     * 备注
     */
    @Excel(name = "备注", width = 15)
    @ApiModelProperty(value = "备注")
    private String remark;
    /**
     * 无税单价
     */
    @Excel(name = "无税单价", width = 15)
    @ApiModelProperty(value = "无税单价")
    private BigDecimal wsdj;
    /**
     * 无税金额
     */
    @Excel(name = "无税金额", width = 15)
    @ApiModelProperty(value = "无税金额")
    private BigDecimal wsje;
    /**
     * 含税单价
     */
    @Excel(name = "含税单价", width = 15)
    @ApiModelProperty(value = "含税单价")
    private BigDecimal hsdj;
    /**
     * 含税金额
     */
    @Excel(name = "含税金额", width = 15)
    @ApiModelProperty(value = "含税金额")
    private BigDecimal hsje;
    /**
     * 税率
     */
    @Excel(name = "税率", width = 15)
    @ApiModelProperty(value = "税率")
    @Dict(dicCode = "tax_rate")
    private BigDecimal sl;
    /**
     * 部门
     */
    @Excel(name = "部门", width = 15)
    @ApiModelProperty(value = "部门")
    @Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
    private String dept;
    /**
     * 税额
     */
    @Excel(name = "税额", width = 15)
    @ApiModelProperty(value = "税额")
    private BigDecimal psTax;
    /**
     * 盘点单号
     */
    @Excel(name = "盘点单号", width = 15)
    @ApiModelProperty(value = "盘点单号")
    private java.lang.String pdNo;
    /**
     * 入库分摊含税单价
     */
    @Excel(name = "入库分摊含税单价", width = 15)
    @ApiModelProperty(value = "入库分摊含税单价")
    private BigDecimal rkftJine;
    /**
     * 调拨单号
     */
    @Excel(name = "调拨单号", width = 15)
    @ApiModelProperty(value = "调拨单号")
    private java.lang.String dbNo;
    /**
     * 是否审核过
     */
    @Excel(name = "是否审核过", width = 15)
    @ApiModelProperty(value = "是否审核过")
    private String isShjl;
    /**
     * 附件
     */
    @Excel(name = "附件", width = 15)
    @ApiModelProperty(value = "附件")
    private String fj;

    private String fj2;

    private String fj3;

    /**
     * 销售发票总金额
     */
    @Excel(name = "销售发票总金额", width = 15)
    @ApiModelProperty(value = "销售发票总金额")
    private BigDecimal xsJine;
    /**
     * 租户id
     */
    @Excel(name = "租户id", width = 15)
    @ApiModelProperty(value = "租户id")
    private Integer tenantId;
    /**
     * 成本调整金额
     */
    @Excel(name = "成本调整金额", width = 15)
    @ApiModelProperty(value = "成本调整金额")
    private BigDecimal tzJine;
    /**
     * 调整后成本金额
     */
    @Excel(name = "调整后成本金额", width = 15)
    @ApiModelProperty(value = "调整后成本金额")
    private BigDecimal tzhJine;
    /**内部编号*/
    @Excel(name = "内部编号", width = 15)
    @ApiModelProperty(value = "内部编号")
    private String tradecode;
    /**编辑前入库单号*/
    @Excel(name = "编辑前入库单号", width = 15)
    @ApiModelProperty(value = "编辑前入库单号")
    private String bjRkno;
    /**编辑前出库量*/
    @Excel(name = "编辑前出库量", width = 15)
    @ApiModelProperty(value = "编辑前出库量")
    private BigDecimal bjXcl;
    /**
     * 出库成本金额2
     */
    private BigDecimal cbJineTwo;
    /**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
    /**机构编码*/
    @ApiModelProperty(value = "机构编码")
    private String sysOrgCode;
//    /**是否开完采购发票*/
//    @ApiModelProperty(value = "是否开完采购发票（0：否，1：是）")
//    private Integer isKaiwp;
//    /**手动填成本金额*/
//    @ApiModelProperty(value = "手动填成本金额")
//    private BigDecimal sdCbjine;

    @TableField(exist=false)
    private List<WarehouseOrderVo> warehouseOrders;

    //    @Override
//    public int compareTo(@NotNull SoOrderDetail o) {
//        return o.getCreateTime().compareTo(this.createTime);
//    }

    @Override
    public int compareTo(@NotNull SoOrderDetail o) {
        return this.createTime.compareTo(o.getCreateTime());
    }
}
